<!--title-->
<div class="mnav1">
	<div class="m_nav">
		<div class="nav_left">
			<em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
		</div>
	</div>
</div>

<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<br />
<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<br />
<?php endif;?>
<form action="/maozhua/index-data-zj" name="form1" method="GET">
公司名称：<input type="text" name="keyword" <?php if($this->keyword){echo "value='".$this->keyword."'";}?> />
&nbsp;&nbsp;&nbsp;&nbsp;
记录日期：<input type="text" name="date_start" id="date_start" autocomplete="off" style="width: 100px"> ~ <input type="text" name="date_end" id="date_end" autocomplete="off" style="width: 100px">
&nbsp;&nbsp;&nbsp;&nbsp;
<br>
之家开关：
<select name="account_status">
    <option value="">请选择</option>
    <option value="0" <?php if(isset($this->account_status) && $this->account_status==0){echo 'selected=selected';}?>>关闭</option>
    <option value="1" <?php if($this->account_status==1){echo 'selected=selected';}?>>开启</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
之家状态：
<select name="status_zj">
    <option value="">请选择</option>
    <option value="1" <?php if($this->status_zj==1){echo 'selected=selected';}?>>下线</option>
    <option value="2" <?php if($this->status_zj==2){echo 'selected=selected';}?>>正常</option>
</select>

&nbsp;&nbsp;&nbsp;&nbsp;
之家满分：
<select name="zj_manfen">
    <option value="">请选择</option>
    <option value="1" <?php if($this->zj_manfen==1){echo 'selected=selected';}?>>否</option>
    <option value="2" <?php if($this->zj_manfen==2){echo 'selected=selected';}?>>是</option>
</select>

&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" class="button" value="搜索" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="button-cancle" value="清空搜索条件" onclick="location.href='?';" />
</form>
<br />
<table>
  <tr>    
    <th>公司</th>
    <th>记录时间</th>
	<th>开关</th>
    <th>状态</th>
    <th>总分</th>
    <th>是否满分</th>
	<th>文章覆盖度得分</th>
	<th>推荐名额使用率得分</th>
	<th>400接起得分</th>
	<th>商业产品发布额分</th>
    <th>推荐名额</th>
    <th>文章覆盖</th>
  </tr>

    <?php $data = $this->data['current_page_info'];?>
    <?php if($data["log_id"]):?>
        <?php foreach($data["log_id"] as $id => $something):?>
  
  <?php
	$zj_score = "";
	$zj_manfen = "";
	$zj_minger = "";
	$zj_fugai = "";

	
	if($data['status_zj'][$id])
	{
		$data_zj = Zend_Json::decode($data['data_zj'][$id]);

		$zj_score_arr = array();
		$corver_score_arr = array();
		$recommend_rate_score_arr = array();
		$pickup_score_arr = array();
		$prod_publish_score_arr = array();
		 
		if($data_zj['data']['yunying'])
		{
			foreach($data_zj['data']['yunying'] as $fdata)
			{
				$zj_score_arr[] = $fdata['totalScore'];
				$corver_score_arr[] = $fdata['corverScore'];
				$recommend_rate_score_arr[] = $fdata['recommendRateScore'];
				if($fdata["pickupScore"])
				{
					$pickup_score_arr[] = $fdata["pickupScore"];
				}
				if($fdata["prodPublishScore"])
				{
					$prod_publish_score_arr[] = $fdata["prodPublishScore"];
				}
			}

			$zj_score = implode("/", $zj_score_arr);
			$corver_score = implode("/", $corver_score_arr);
			$recommend_rate_score = implode("/", $recommend_rate_score_arr);
			$pickup_score = implode("/", $pickup_score_arr);
			$prod_publish_score = implode("/", $prod_publish_score_arr);
		}

		$zj_manfen = $data_zj['data']['manfen']?"<font color='green'>是</font>":"<font color='red'>否</font>";                
            
		$haofei = $data_zj['data']['haofei']?$data_zj['data']['haofei']:0;
		$zongedu = ($data_zj['data']['haofei']+$data_zj['data']['shengyu'])?($data_zj['data']['haofei']+$data_zj['data']['shengyu']):0;

		$zj_minger = $haofei."/".$zongedu;

		$series1 = 0; //有文章
		$series2 = 0; //总数

		if($data_zj['data']['series'])
		{
			foreach($data_zj['data']['series'] as $se)
			{
				$series2 += 1;
				
				$str = str_replace("）", "", $se['_name']);
				$ex = explode("（", $str);

				if(2 == count($ex))
				{
					if(0 < $ex[1])
					{
						$series1 += 1;
					}
				}
			}
		}
		
		$zj_fugai = $series1."/".$series2;
		
		if($series1 != $series2)
		{
			$zj_fugai = "<font color='red'>".$zj_fugai."</font>";
		}
	}

	$yc_score = "";
	$yc_manfen = "";
	$yc_topic1 = "";
	$yc_topic2 = "";

	if($data['status_yc'][$id])
	{
		$data_yc = Zend_Json::decode($data['data_yc'][$id]);

		$yc_score_arr = array();

		if($data_yc['data']['yunying'])
		{
			foreach($data_yc['data']['yunying'] as $fdata)
			{
				$yc_score_arr[] = $fdata['totalScore'];
			}

			$yc_score = implode("/", $yc_score_arr);
		}

		$yc_manfen = $data_yc['data']['isScore100']?"<font color='green'>是</font>":"<font color='red'>否</font>";
		$yc_topic1 = $data_yc['data']['jiangjiaNewsCover']?$data_yc['data']['jiangjiaNewsCover']:"-";
		$yc_topic2 = $data_yc['data']['zhihuanNewsCover']?$data_yc['data']['zhihuanNewsCover']:"-";

	}
  ?>
  
  <tr>    
    <td><?=$data['user_name'][$id]?></td>
    <td><?=$data['ctime'][$id]?></td>
	<td><?=$data['status'][$id]?"<font color='green'>开启</font>":"<font color='red'>关闭</font>"?></td>
    <td><?=$data['status_zj'][$id]?"<font color='green'>正常</font>":"<font color='red'>下线</font>"?></td>
    <td><?=$zj_score?></td>	
    <td><?=$zj_manfen?></td>
	<td><?php if($corver_score <> -1){ echo $corver_score;}?></td>
	<td><?php if($recommend_rate_score <> -1){ echo $recommend_rate_score;} ?></td>
	<td><?=$pickup_score?></td>
	<td><?=$prod_publish_score?></td>
    <td><?=$zj_minger?></td>
    <td><?=$zj_fugai?></td>
  </tr>
  <?php endforeach;?>
  <?php endif;?>
</table>
    <br /><br />
    <div align="right"><?=$this->pagination?></div>
    <br /><br /><br />
<br /><br />

    <script>
        var date = new Date();//获取当前时间
        date.setDate(date.getDate()-1);

        $(function() {
            $( "#date_start" ).datepicker({ dateFormat: 'yy-mm-dd'}).datepicker("setDate", "<?=$this->date_start?>");
        });

        $(function() {
            $( "#date_end" ).datepicker({ dateFormat: 'yy-mm-dd'}).datepicker("setDate", "<?=$this->date_end?>");
        });
    </script>